package core

var (
	StaticCoreGlobalProperty = &CoreGlobalProperty{
		BeanRefContextConf:       "beanRefContext.xml",
		BeanConf:                 "zstack.xml",
		VmTracerOn:               true,
		ExitJVMOnBootFailure:     true,
		PidFilePath:              "management-server.pid", // "/run/zstack/management-server.pid", //todo
		ConsoleProxyOverriddenIp: "0.0.0.0",
		ExitJVMOnStop:            true,
		Locale:                   "zh_CN",
		RESTFacadeReadTimeout:    300000,
		RESTFacadeConnectTimeout: 15000,
		RESTFacadeEchoTimeout:    60,
		RESTFacadeMaxPerRoute:    2,
		RESTFacadeMaxTotal:       128,
		ConsoleProxyPort:         4900,
		HttpConsoleProxyPort:     4901,
		DataDir:                  "/var/lib/zstack/",
		LogDir:                   "/var/log/zstack/",
		UpdatePkgWhenConnect:     true,
		SyncNodeTime:             true,
		EnableElaboration:        true,
		RESTApiResultMaxLength:   64000,
	}
)

type CoreGlobalProperty struct {
	// @GlobalProperty(name = "unitTestOn", defaultValue = "false")
	UnitTestOn bool

	// @GlobalProperty(name = "beanRefContextConf", defaultValue = "beanRefContext.xml")
	BeanRefContextConf string

	// @GlobalProperty(name = "beanConf", defaultValue = "zstack.xml")
	BeanConf string

	// @GlobalProperty(name = "vmTracerOn", defaultValue = "true")
	VmTracerOn bool

	// @GlobalProperty(name = "profiler.workflow", defaultValue = "false")
	ProfilerWorkflow bool

	// @GlobalProperty(name = "profiler.httpCall", defaultValue = "false")
	ProfilerHttpCall bool

	// @GlobalProperty(name = "exitJVMOnBootFailure", defaultValue = "true")
	ExitJVMOnBootFailure bool

	// @GlobalProperty(name = "checkBoxTypeInInventory", defaultValue = "false")
	CheckBoxTypeInInventory bool

	// @GlobalProperty(name = "pidFilePath", defaultValue = "{user.home}/management-server.pid")
	PidFilePath string

	// @GlobalProperty(name = "consoleProxyOverriddenIp", defaultValue = "0.0.0.0")
	ConsoleProxyOverriddenIp string

	// @GlobalProperty(name = "exposeSimulatorType", defaultValue = "false")
	ExposeSimulatorType bool

	// @GlobalProperty(name = "exitJVMOnStop", defaultValue = "true")
	ExitJVMOnStop bool

	// @GlobalProperty(name = "locale", defaultValue = "zh_CN")
	Locale string

	// @GlobalProperty(name = "user.home")
	UserHome string

	// @GlobalProperty(name = "RESTFacade.readTimeout", defaultValue = "300000")
	RESTFacadeReadTimeout uint64

	// @GlobalProperty(name = "RESTFacade.connectTimeout", defaultValue = "15000")
	RESTFacadeConnectTimeout uint64

	// @GlobalProperty(name = "RESTFacade.echoTimeout", defaultValue = "60")
	RESTFacadeEchoTimeout uint64

	// @GlobalProperty(name = "RESTFacade.maxPerRoute", defaultValue = "2")
	RESTFacadeMaxPerRoute uint64

	// @GlobalProperty(name = "RESTFacade.maxTotal", defaultValue = "128")
	RESTFacadeMaxTotal uint64

	// @GlobalProperty(name = "upgradeStartOn", defaultValue = "false")
	UpgradeStartOn bool

	// @GlobalProperty(name = "shadowEntityOn", defaultValue = "false")
	ShadowEntityOn bool

	// @NumberRange({1024, 49151})
	// @GlobalProperty(name = "consoleProxyPort", defaultValue = "4900")
	ConsoleProxyPort uint64 `validate:"gte=1024,lte=49151"` // for vnc

	// @GlobalProperty(name = "httpConsoleProxyPort", defaultValue = "4901")
	// @NumberRange({1024, 49151})
	HttpConsoleProxyPort uint64 `validate:"gte=1024,lte=49151"`

	// @GlobalProperty(name = "consoleProxyCertFile", defaultValue = "")
	ConsoleProxyCertFile string

	// @GlobalProperty(name = "dataDir", defaultValue = "/var/lib/zstack/")
	DataDir string

	// @GlobalProperty(name = "logDir", defaultValue = "{catalina.home}/logs/")
	LogDir string

	// @GlobalProperty(name="chrony.serverIp.")
	ChronyServers []string

	// @GlobalProperty(name="management.server.vip")
	MNVIp string

	// @GlobalProperty(name = "simulatorsOn", defaultValue = "false")
	SimulatorsOn bool

	// @GlobalProperty(name = "updatePkgWhenConnect", defaultValue = "true")
	UpdatePkgWhenConnect bool

	// @GlobalProperty(name = "syncNodeTime", defaultValue = "true")
	SyncNodeTime bool

	// @GlobalProperty(name = "enableElaboration", defaultValue = "true")
	EnableElaboration bool

	// @GlobalProperty(name = "recordElaboration", defaultValue = "false")
	RecordElaboration bool

	// @GlobalProperty(name = "chain.task.qos", defaultValue = "false")
	ChainTaskQos string

	// @GlobalProperty(name = "rest.api.result.max.length", defaultValue = "64000")
	RESTApiResultMaxLength uint64
}
